﻿using Himp.Base;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace Himp.Outpatient
{
    /// <summary>
    /// 门诊挂号记录
    /// </summary>
    public class OtpRgstRec : AuditedAggregateRoot<Guid>, IMultiTenant
    {
        /// <summary>
        /// 就医流水号
        /// 如果是医保 就使用医保 返回的mdtrt_id
        /// 如何是现金 就按照规则生成
        /// </summary>
        public string MdtrtSn { get; private set; }

        /// <summary>
        /// 结算类型编码
        /// 00 现金
        /// 01 大连医保
        /// 02 沈阳医保
        /// </summary>
        public string SetlTypeCode { get; set; }

        /// <summary>
        /// 结算类型名称
        /// </summary>
        public string SetlTypeName { get; set; }

        /// <summary>
        /// 险种类型
        /// </summary>
        public string? InsutypeCode { get; set; }

        /// <summary>
        /// 险种类型
        /// </summary>
        public string? InsutypeName { get; set; }

        /// <summary>
        /// 就诊凭证类型
        /// </summary>
        public string MdtrtCertTypeCode { get; set; }

        /// <summary>
        /// 就诊凭证编号
        /// </summary>
        public string MdtrtCertNo { get; set; }

        /// <summary>
        /// 患者Id
        /// </summary>
        public Guid? PatnId { get; set; }

        /// <summary>
        /// 患者编号(医保)
        /// </summary>
        public string? PsnNo { get; set; }

        /// <summary>
        /// 门诊号
        /// </summary>
        public string OtpNo { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        public string PatnName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public EnumGender Gender { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }

        /// <summary>
        /// 门诊排班记录id
        /// </summary>
        public Guid OtpSchdRecId { get; set; }

        /// <summary>
        /// 门诊排班记录明细id
        /// </summary>
        public Guid? OtpSchdRecDetlId { get; set; }

        /// <summary>
        /// 门诊挂号类别ID
        /// </summary>
        public Guid OtpRgstTypeId { get; set; }

        /// <summary>
        /// 挂号日期
        /// </summary>
        public DateTime RgstDate { get; set; }

        /// <summary>
        /// 科室编码
        /// </summary>
        public string DeptCodg { get; set; }

        /// <summary>
        /// 科室名称
        /// </summary>
        public string DeptName { get; set; }

        /// <summary>
        /// 医师编码
        /// </summary>
        public string? DrCodg { get; set; }

        /// <summary>
        /// 医师姓名
        /// </summary>
        public string? DrName { get; set; }

        ///// <summary>
        ///// 订单ID
        ///// </summary>
        //public Guid? OrderId { get; set; }

        //// <summary>
        ///// 退款单ID
        ///// </summary>
        //public Guid? RefundId { get; set; }

        /// <summary>
        /// 挂号状态
        /// </summary>
        public EnumRgstStatus RgstStas { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? TenantId { get; set; }


        #region 方法

        public OtpRgstRec()
        {

        }

        public OtpRgstRec(string mdtrtSn, string setlTypeCode, string setlTypeName, Guid? patnId, int age, EnumGender gender, string otpNo, string patnName, Guid otpSchdRecId
            , Guid? otpSchdRecDetlId, Guid otpRgstTypeId, DateTime rgstDate, string deptCodg, string deptName,
            string? drCodg, string? drName, string mdtrtCertTypeCode, string mdtrtCertNo)
        {
            MdtrtSn = mdtrtSn;
            SetlTypeCode = setlTypeCode;
            SetlTypeName = setlTypeName;
            PatnId = patnId;
            Age = age;
            Gender = gender;
            OtpNo = otpNo;
            PatnName = patnName;
            OtpSchdRecId = otpSchdRecId;
            OtpSchdRecDetlId = otpSchdRecDetlId;
            RgstDate = rgstDate;
            DeptCodg = deptCodg;
            DeptName = deptName;
            DrCodg = drCodg;
            DrName = drName;
            OtpRgstTypeId = otpRgstTypeId;
            MdtrtCertTypeCode = mdtrtCertTypeCode;
            MdtrtCertNo = mdtrtCertNo;
            RgstStas = EnumRgstStatus.创建中;
        }

        #endregion
    }
}
